package com.ggqq.factory.simple;

public class Consumer {
    public static void main(String[] args) {
        //1.使用接口和实现类
/*        Car car1 = new WuLing();
        Car car2 = new Tesla();
        car1.name();
        car2.name();*/
        //2.使用工厂
        Car car1 = CarFactory.getCar("五菱宏光");
        Car car2 = CarFactory.getCar("特斯拉");
        car1.name();
        car2.name();

    }
}
